<?php

class tSysModule extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'sys_module':
	 * @var integer $sm_id
	 * @var string $sm_name
	 * @var string $sm_display
	 * @var string $sm_description
	 * @var string $sm_version
	 * @var integer $sm_type
	 * @var integer $sm_state
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sys_module';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		return array(
			array('sm_name','length','max'=>45),
			array('sm_display','length','max'=>45),
			array('sm_description','length','max'=>255),
			array('sm_version','length','max'=>10),
			array('sm_name, sm_display, sm_description, sm_version, sm_type', 'required'),
			array('sm_type, sm_state', 'numerical', 'integerOnly'=>true),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'sm_id' => 'Sm',
			'sm_name' => 'Sm Name',
			'sm_display' => 'Sm Display',
			'sm_description' => 'Sm Description',
			'sm_version' => 'Sm Version',
			'sm_type' => 'Sm Type',
			'sm_state' => 'Sm State',
		);
	}
}